<template>
	<aplid-dialog
		@close="onClose"
		width="85%"
		v-model="visibleForm"
		append-to-body
		whickComm="Archives"
		:customeHeader="customeHeader"
		:model="nowOrgInfo"
	>
		<transition name="fade" mode="out-in">
			<div class="dialog-content w-100" v-show="!Loading">
				<ServiceOrgArchives :showBtn="false" :nowRowData="nowOrgInfo" :tabsList="tabsList"></ServiceOrgArchives>
			</div>
		</transition>
		<PageLoading v-if="Loading" />
	</aplid-dialog>
</template>

<script setup lang="ts">
import { useCommonStore } from '@/stores/common'
import ServiceOrgArchives from '@/views/datacenter/basicData/serviceOrg/components/Archives/index.vue'
import apiMod from '@/apiMod'

const visibleForm = ref(false)
const nowOrgInfo = ref({})

const { setTempParams, setGloablParams, setMoreSearch } = useCommonStore()
const { Loading } = storeToRefs(useCommonStore())

const tabsList = [
	{
		name: 'BaseDetail',
		label: '基本信息',
	},
	{
		name: 'information',
		label: '资料信息',
	},
]
const customeHeader = {
	type: 'CardOne',
	title: 'organizationName',
	avatar: 'organizationLogo',
	tipList: [{ prop: 'operateStatusLabel', type: 'tip-success', label: '运营状态' }],
	tagList: [
		{ prop: 'organizationTypeLabel', custome: 'tag', type: 'success', label: '机构类型' },
		{ prop: 'integrity', type: 'success', label: '材料完整度' },
	],
	menuBtn: [],
}

const onClose = () => {
	setTempParams({})
	setGloablParams({})
	setMoreSearch({})
  visibleForm.value = false
}

const getServiceOrgInfo = (creditCode) => {
	if (!creditCode) return
	apiMod.view_dpServiceOrgBase_creditCode(creditCode).then((res) => {
		nowOrgInfo.value = res.data
		visibleForm.value = true
	})
}

defineExpose({
  getServiceOrgInfo
})
</script>

<style scoped></style>
